package call.count;

import java.io.Serializable;
import java.util.Date;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * 功能：记录统计结果
 *
 * @author baitao20
 * @date 2024/2/20 22:27
 **/
public class CallCountResult implements Serializable {

    /**
     * 自增id
     */
    private Long id;

    /**
     * 平台id，默认1
     */
    private Long platformId = 1L;

    /**
     * jdos 应用id
     */
    private String systemId;

    /**
     * jdos 应用英文名称
     */
    private String systemName;

    /**
     * 本机ip
     */
    private String ip;

    /**
     * 类名称
     */
    private String className;

    /**
     * 方法名称
     */
    private String methodName;

    /**
     * 页面路径
     */
    private String url;

    /**
     * 组件类型
     */
    private Integer type;

    /**
     * 调用次数
     */
    private AtomicInteger count;

    /**
     * 统计开始事件。广播时间
     */
    private Date statStartDate;

    /**
     * 统计结束事件。广播时间
     */
    private Date statEndDate;

    /**
     * 创建事件。广播时间
     */
    private Date createDate;

    /**
     * 修改事件。广播时间
     */
    private Date updateDate;

    /**
     * 创建人，默认system
     */
    private String createBy;

    /**
     * 修改人，默认system
     */
    private String updateBy;

    /**
     * 逻辑删除，0 未删除 1 已删除
     */
    private Integer isDelete;

    /**
     * 乐观锁版本号
     */
    private Long version;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getPlatformId() {
        return platformId;
    }

    public void setPlatformId(Long platformId) {
        this.platformId = platformId;
    }

    public String getSystemId() {
        return systemId;
    }

    public void setSystemId(String systemId) {
        this.systemId = systemId;
    }

    public String getSystemName() {
        return systemName;
    }

    public void setSystemName(String systemName) {
        this.systemName = systemName;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public AtomicInteger getCount() {
        return count;
    }

    public int getCountSorted() {
        if (count == null) {
            return 0;
        } else {
            return count.get();
        }
    }

    public void setCount(AtomicInteger count) {
        this.count = count;
    }

    public Date getStatStartDate() {
        return statStartDate;
    }

    public void setStatStartDate(Date statStartDate) {
        this.statStartDate = statStartDate;
    }

    public Date getStatEndDate() {
        return statEndDate;
    }

    public void setStatEndDate(Date statEndDate) {
        this.statEndDate = statEndDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return "CallCountResult{" +
                "id=" + id +
                ", platformId=" + platformId +
                ", systemId='" + systemId + '\'' +
                ", systemName='" + systemName + '\'' +
                ", ip='" + ip + '\'' +
                ", className='" + className + '\'' +
                ", methodName='" + methodName + '\'' +
                ", url='" + url + '\'' +
                ", type=" + type +
                ", count=" + count +
                ", statStartDate=" + statStartDate +
                ", statEndDate=" + statEndDate +
                ", createDate=" + createDate +
                ", updateDate=" + updateDate +
                ", createBy='" + createBy + '\'' +
                ", updateBy='" + updateBy + '\'' +
                ", isDelete=" + isDelete +
                ", version=" + version +
                '}';
    }
}